<?php
$attributes = array('class' => 'email', 'id' => 'checknew');
echo form_open('news_category/dels', $attributes);?>    
<input type="hidden" name="page" value="<?=(int)$this->uri->segment('3')?>">
<table class="admindata">
    <thead>
        <tr>
            <th colspan="6">
                <input type="submit" onclick="return verify_del();" name="btn_submit" class="submit" value="Xóa">
                Hiện có <?=$num?> chuyên mục <?=$pagination?>
            </th>
        </tr>
        <tr>
            <th class="checkbox"><input type="checkbox" name="sa" id="sa" onclick="check_chose('sa', 'ar_id[]', 'checknew')" /></th>
            <th><?=lang('news_category');?></th>
            <th width="200">Tên nhóm tin</th>
            <th width="200">Menu</th>
            <th width="200">Thứ tự</th>
            <th class="publish" style="width: 90px;">Active</th>
        </tr>                
    </thead>
    <?
    $k=1;
    foreach($list as $rs):
		if($rs->parent_id==0){
		$listsub = $this->news_category->adminGetCategory($rs->cat_id);
	?>
        <tr class="row<?=$k?>">
            <td><input type="checkbox" name="ar_id[]" value="<?=$rs->cat_id?>"></td>
            <td><a href=""><?=$rs->cat_name?></a></td>
            <td><?=$rs->name_block?></td>
            <td><?=$rs->is_menu?></td>
            <td><?=$rs->nb_order?></td>
            <td align="center">
                <?=icon_edit('news_category/edit/'.$rs->cat_id)?>
                <span id="publish<?=$rs->cat_id?>"><?=icon_active("'news_category'","'cat_id'",$rs->cat_id,$rs->bl_active)?></span>
                <?=icon_del('news_category/del/'.$rs->cat_id.'/'.(int)$this->uri->segment(4))?>
            </td>
        </tr>
    <?
		}
		foreach($listsub as $row):
	?>
        <tr class="row<?=$k?>">
            <td><input type="checkbox" name="ar_id[]" value="<?=$row->cat_id?>"></td>
            <td>___<a href=""><?=$row->cat_name?></a></td>
            <td><?=$row->name_block?></td>
            <td><?=$row->is_menu?></td>
            <td>___<?=$row->nb_order?></td>
            <td align="center">
                <?=icon_edit('news_category/edit/'.$row->cat_id)?>
                <span id="publish<?=$rs->cat_id?>"><?=icon_active("'news_category'","'cat_id'",$row->cat_id,$row->bl_active)?></span>
                <?=icon_del('news_category/del/'.$row->cat_id.'/'.(int)$this->uri->segment(4))?>
            </td>
        </tr>
    <?
        $k=1-$k;
		endforeach;
    endforeach;
	?>
    <tfoot>
        <td colspan="6">
            <input type="submit" class="submit" onclick="return verify_del();" name="btn_submit" value="Xóa">
            Hiện có <?=$num?> chuyên mục <?=$pagination?>
        </td>
    </tfoot>
</table>  
<?=form_close()?>  
